<?php
namespace BigVideo\Other\Observer;

/**
 * 具体的观察者对象。实现更新方法，使自身的状态和目标的状态保持一致
 * Class ConcreteObserver
 * @package BigVideo\Other\Observer
 */
class ConcreteObserver implements Observer
{
    /**
     * 观察者名称
     */
    private $name;

    /**
     * 做的事情
     */
    private $remindThing;

    public function getName()
    {
        return $this->name;
    }

    /**
     * @param mixed $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * @param mixed $remindThing
     */
    public function setRemindThing($remindThing)
    {
        $this->remindThing = $remindThing;
    }

    /**
     * @return mixed
     */
    public function getRemindThing()
    {
        return $this->remindThing;
    }

    /**
     * @param WeatherSubject|ConcreteWeatherSubject $subject
     * @return mixed|void
     */
    public function update(WeatherSubject $subject)
    {
        var_dump( $this->getName()."收到了".$subject->getWeatherContent().$this->getRemindThing().',至上');
    }
}